{include file="public/header" /}
<div class="page">
   <form id="form" method="post" name="form1">
       <input type="hidden" name="id" value="{$data.id}" id="id"/>
       <table class="ds-default-table" style="margin-top: 10px;">
           <tr class="noborder">
               <td class="required w120"><label class="validation">余额:</label></td>
               <td class="vatop rowform">
                       <span style="font-size: 18px;">￥</span>
                   <input type="text" value="{if $data.money}{$data.money}{else/}0.00{/if}" name="money" id="money">
               </td>
               <td class="vatop tips"></td>
           </tr>
           <tfoot>
           <tr class="tfoot" style="margin-top: 15px;">
               <td colspan="2" align="center"><input class="btn" type="submit" value="提交"></td>
           </tr>
           </tfoot>
       </table>

    </form>
</div>
<script>

    $(document).ready(function () {
        $("#form").validate({
            errorPlacement: function (error,element) {
                error.appendTo(element.parent().parent().find('td:last'));
            },
            rules:{
                money:{
                    remote:{
                        url: ADMINSITEURL+'/Fupersonal/ajax.html?branch=check_money',
                        type:'get',
                        data:{
                            money:function () {
                                return $('#money').val();
                            }
                        }
                    }
                }
            },
            messages:{
                money:{
                    remote:'请正确输入余额'
                }
            }
        });
        //自定义正则表达示验证方法
        $.validator.addMethod("checkphone",function(value,element,params){
            var checkQQ = /^[1][3,4,5,7,8,9][0-9]{9}$/;
            return this.optional(element)||(checkQQ.test(value));
        },"{$Think.lang.fuwu_personal_phone_geshi}");
    });
</script>